<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@page import="java.util.*, model.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<HEAD>
<TITLE> Whats your address !</TITLE>
</HEAD>
<BODY>
	<html:errors />
	
	
	
		<%		   		
		   	Applicant applicant = (Applicant)session.getAttribute("applicant");
			Vector<String> countriesVector = (Vector) session.getAttribute("countriesVector");
			Vector<String> statesVector = (Vector) session.getAttribute("statesVector");
		 %>
		
		<%="Name: " + applicant.getName() %><br />
		<%= "Country of Citizenship: " + applicant.getCitizenship() %> <br />
		<%="Country of Residence: " + applicant.getCountry_of_residence()%>
		
	<hr /><br /> Please enter your name below: <br /><br />
	
	<html:form action="/address" focus="street">
		<TABLE border="0" width="100%">
			<TR>
				<TH align="right">Street Address:</TH>
				<TD align="left"><html:text property="street" />
				</TD>
			</TR>
			<TR>
				<TH align="right">City:</TH>
				<TD align="left"><html:text property="city" />
				</TD>
			</TR>
			<%if(applicant.isDomestic()){ %>
			<html:hidden property="us" value="true" />
			<TR>
				
				<TH align="right">State:</th>
				<td>
				<%
					int count = statesVector.size();
					out.println("<select name=\"state\">");
					for (int i =0; i< count; i++) {
						out.println("<option value=\""+ statesVector.get(i) + "\">" + statesVector.get(i) + "</option>");
					}
					out.println("</select><br/>");
				%>
				</td>
				
			</TR>
			<%}%>
			<TR>
				<TH align="right">Zip Code:</TH>
				<TD align="left"><html:text property="zipCode" />
				</TD>
			</TR>
			<%if(!applicant.isDomestic()){ %>
			<html:hidden property="us" value="false" />
			<TR>
				<TH align="right">Country Telephone Code:</TH>
				<TD align="left"><html:text property="countryTelephoneCode" />
				</TD>
			</TR>
			<%}%>
			<TR>
				<TH align="right">Area Code:</TH>
				<TD align="left"><html:text property="areaCode" />
				</TD>
			</TR>
			<TR>
				<TH align="right">Phone Number:</TH>
				<TD align="left"><html:text property="phoneNumber" />
				
				<!--<html:hidden property="us" value="false" />-->
				</TD>
			</TR>
			<TR>
				<TD align="right"><html:submit />
				</TD>
				<TD align="left"><html:reset />
				</TD>
			</TR>
		</TABLE>
	</html:form>
</BODY>
</html:html>